#ifndef __COMMAND_VARIABLE_H__
#define __COMMAND_VARIABLE_H__

class CommandVariable
{
public:
	CommandVariable();
	~CommandVariable();

	struct CVar
	{
		char *name;
		char *string;
		char *latched_string;
		int flags;
		bool modified;
		float value;
		struct CVar* next;
	};

	static bool info_validate( char *s );
	static CommandVariable* find_variable( char *var_name );
	float get_value( char *var_name );
	char* get_string( char *var_name );
	char* complete_variable( char* partial );
	CommandVariable* cvar_get( char* var_name, char* var_value, int flags );
	CommandVariable* set2( char* var_name, char* value, bool force );
	CommandVariable* force_set( char* var_name, char* value );
	CommandVariable* full_set( char* var_name, char* value, int flags );
	void setvalue( char* var_name, float value );
	char* bit_info( int bit );

private:
	CVar* cvar_vars;
	bool modified;

	const unsigned int MAX_INFO_STRING = 1024;
};

#endif
